import React, { Component } from "react";

//todo 插槽使用this.props.children接收
//todo 可以插文本，标签和组件
class Child extends Component {
  render() {
    // console.log(this);
    // const { children } = this.props;
    const {
      props: { children },
    } = this;
    return <div>child组件 - {children}</div>;
  }
}

class App extends Component {
  render() {
    return (
      <>
        <h2>children</h2>
        <Child>
          <span>123</span>
        </Child>
      </>
    );
  }
}

export default App;
